<?php

	include_once $_SERVER["DOCUMENT_ROOT"].'/service/entite/role/RoleService.php';
	include_once $_SERVER["DOCUMENT_ROOT"].'/service/entite/role/RoleEntite.php';
	include_once $_SERVER["DOCUMENT_ROOT"].'/service/uc/gererrole/RoleVO.php';
	include_once $_SERVER["DOCUMENT_ROOT"].'/service/uc/gererrole/GererRoleVOAssembler.php';
	
	class GererRoleService {
		public static function ajouterRole() {
			$role = RoleService::createRole();
			return GererRoleVOAssembler::createRoleVO($role);
		}
		
		public static function modifierRole($id) {
			$role = RoleService::getRoleForModification($id);
			return GererRoleVOAssembler::createRoleVO($role);
		}
		
		public static function validerRole(RoleVO $roleVO) {
			$role = GererRoleVOAssembler::getEntity($roleVO);
			//Sauvegarde du role
			RoleService::save($role);
		}
		
		public static function supprimerRole($id) {
			RoleService::supprimerRole($id);
		}
		
		public static function getListeRoleVO() {
			$listeRole = RoleService::getListeRole();
			return GererRoleVOAssembler::createListeRoleVO($listeRole);
		}
		
		
	}
?>